CC = gcc
CFLAGS = -O3 
LDFLAGS = 
LIBS     = 

SHA1 = sha1
SHA1_O = sha1.o

PRNG = prng
PRNG_O = rand.o prng.o

all: sha1_objs sha1_prog prng_objs prng_prog

sha1_prog:
	$(CC) $(CFLAGS) $(LDLAGS) -o $(SHA1) $(SHA1_O) $(LIBS)

sha1_objs:   $(SHA1_O)

prng_prog:
	$(CC) $(CFLAGS) $(LDLAGS) -o $(PRNG) $(PRNG_O) $(LIBS)

prng_objs:   $(PRNG_O)

.c.o:
	$(CC) $(CFLAGS) -c -o $*.o $< 

.c.s:
	$(CC) $(CFLAGS) -S -o $*.s $<

.o:
	$(CC) $(CFLAGS) $(LDLAGS) -o $* $(SHA1_O) $(LIBS)

clean: cleanbin
	rm -f *.o *~

cleanbin:
	rm -f $(SHA1) $(PRNG)

